package cn.jason.mapper;

import cn.jason.domain.Goods;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Map;
/**
 * @Author: Jason
 * @Date: 2022/9/19 18:53
 */
public interface GoodsMapper {

     @Update("update t_goods set count=count-#{num} where id = #{id}")
     void updateNum(Map<String,Object> params);

     @Select("select * from t_goods where id = #{id}")
     Goods laodById(Long id);

     @Select("select * from t_goods where id = #{id} for update")
     Goods laodByIdForUpdate(Long id);
}
